package com.bjpower.convent;

import com.bjpower.common.enums.PublicStatus;
import org.mapstruct.Named;
import org.springframework.stereotype.Component;

@Component
public class MapperHelder {
    // 将Status转换为汉字的方法
    @Named("statusConvent")
    public String statusConvent(String status) {

        try{
            PublicStatus publicStatus = PublicStatus.valueOf(status);
            return publicStatus.getText();
        }catch (Exception e){
            e.printStackTrace();
        }
        return "未知";
    }

    @Named("translateAutoSett")
    public String translateAutoSett(String autoSett){
        if("YES".equals(autoSett)){
            return "是";
        }
        return "否";
    }
}
